package com.aibaixun.web.controller.system;

import com.aibaixun.common.core.domain.R;
import com.aibaixun.system.domain.PlatformConfig;
import com.aibaixun.system.service.PlatformConfigService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * 平台配置文件信息管理模块
 *
 * @author zhangyh
 * @date 2023-09-01
 **/
@RestController
@RequestMapping("/platform/config" )
public class PlatformConfigController {

    @Autowired
    private PlatformConfigService platformConfigService;

    /**
     * 查询配置文件信息
     * @return
     */
    @ApiOperation(value = "查询配置文件信息")
    @GetMapping("/detail/{configId}")
    public R<PlatformConfig> getList(@PathVariable(value = "configId") Integer configId){
        return platformConfigService.getDetail(configId);
    }

    /**
     * 更新配置文件信息
     * @return
     */
    @PostMapping("/update")
    public R update(@RequestBody PlatformConfig dto) {
        return platformConfigService.update(dto);
    }


}
